/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2014-2016 abel533@gmail.com
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

package com.cloud.logger.zchain.zchainserver.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.cloud.logger.zchain.zchainserver.entity.propertyenum.MailSendTypeEnum;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.Date;

/**
 * 浙江卓锐科技股份有限公司
 *
 * @author zhengyt
 * @create 2017/11/9
 * @description
 */
@Data
@Document
public class MailSuccess {
    @Id
    private String id;
    @ApiModelProperty(name = "address", notes = "邮箱地址", example = "999999@qq.com")
    private String address;
    @ApiModelProperty(name = "content", notes = "邮件内容", example = "3344")
    private String content;

    @JsonProperty("create_time")
    @JSONField(name = "create_time", format = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(name = "create_time", notes = "创建时间", example = "2017-11-09 09:01:01")
    private Date createTime;

    @JsonProperty("code")
    @JSONField(name = "code")
    @ApiModelProperty(name = "code", notes = "编码", example = "1")
    @NotBlank(message ="code字段不能为空")
    private String code;

    @JsonProperty("ip")
    @JSONField(name = "ip")
    @ApiModelProperty(name = "ip", notes = "安装ip地址", example = "10.0.0.1")
    private String ip;

    @JsonProperty("port")
    @JSONField(name = "port")
    @ApiModelProperty(name = "port", notes = "端口", example = "8080")
    private String port;

    @JsonProperty("send_time")
    @JSONField(name = "send_time", format = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(name = "send_time", notes = "发送时间", example = "2017-11-09 09:01:01")
    private Date sendTime;

    @JsonProperty("mail_send_type")
    @JSONField(name = "mail_send_type")
    @ApiModelProperty(name = "mail_send_type", notes = "发送类型(mail/message)", example = "mail")
    private MailSendTypeEnum mailSendType;

}
